<!-- {% if latest_question_list %}
    <ul>
    {% for question in latest_question_list %}
        <li><a href="/polls/{{ question.id }}/">{{ question.question_text }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %} -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Poll List</title>
    <style>
        :root {
            --primary: #6c5ce7;
            --secondary: #a29bfe;
            --accent: #fd79a8;
            --light: #f8f9fa;
            --dark: #2d3436;
            --success: #00b894;
            --info: #0984e3;
            --warning: #fdcb6e;
            --danger: #d63031;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: var(--dark);
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        h1 {
            color: var(--primary);
            text-align: center;
            margin-bottom: 30px;
            font-size: 2.5rem;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
            background: linear-gradient(to right, var(--primary), var(--accent));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            padding-bottom: 10px;
            border-bottom: 3px solid var(--secondary);
        }
        
        ul {
            padding-left: 0;
            list-style: none;
            display: grid;
            gap: 15px;
        }
        
        .question-list li {
            background: white;
            margin-bottom: 15px;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            border-left: 5px solid var(--primary);
            position: relative;
            overflow: hidden;
        }
        
        .question-list li::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 5px;
            height: 100%;
            background: linear-gradient(to bottom, var(--primary), var(--accent));
        }
        
        .question-list li:nth-child(odd) {
            border-left-color: var(--info);
        }
        
        .question-list li:nth-child(even) {
            border-left-color: var(--success);
        }
        
        .question-list li:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.15);
        }
        
        .question-list li a {
            color: var(--dark);
            text-decoration: none;
            font-size: 1.2rem;
            display: block;
            font-weight: 500;
            position: relative;
            padding-left: 15px;
        }
        
        .question-list li a::before {
            content: "→";
            position: absolute;
            left: -5px;
            color: var(--accent);
            transition: all 0.3s;
        }
        
        .question-list li:hover a::before {
            left: -10px;
        }
        
        .no-polls {
            text-align: center;
            font-size: 1.2rem;
            color: var(--dark);
            padding: 30px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        
        footer {
            text-align: center;
            margin-top: 40px;
            color: var(--dark);
            font-size: 0.9rem;
        }

        /* 新增的管理后台按钮样式 */
        .admin-btn-container {
            text-align: center;
            margin-top: 30px;
            margin-bottom: 20px;
        }
        
        .admin-btn {
            display: inline-block;
            background: linear-gradient(135deg, var(--primary), var(--accent));
            color: white;
            padding: 12px 25px;
            border-radius: 30px;
            font-weight: 600;
            font-size: 1rem;
            text-decoration: none;
            box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
            transition: all 0.3s ease;
            border: none;
            cursor: pointer;
        }
        
        .admin-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
            background: linear-gradient(135deg, var(--accent), var(--primary));
        }
        
        .admin-btn:active {
            transform: translateY(1px);
        }
        
        .admin-btn i {
            margin-right: 8px;
        }




    </style>
</head>
<body>
    <h1>投票系统</h1>
    
    {% if latest_question_list %}
        <ul class="question-list">
        {% for question in latest_question_list %}
            <li><a href="/polls/{{ question.id }}/">{{ question.question_text }}</a></li>
        {% endfor %}
        </ul>
    {% else %}
        <p class="no-polls">暂无可用投票.</p>
    {% endif %}
    
    <footer>
        © 2025 投票系统 | 
    </footer>

    <!-- 新增的管理后台按钮 -->
    <div class="admin-btn-container">
        <a href="/admin/" class="admin-btn">
            <i class="fas fa-cog"></i> 进入管理系统后台
        </a>
    </div>

    
</body>
</html>

